n = int(input())
m = n
c = 0
while (m != 0):
    c = (m % 10)
    m = int(m / 10)
print(c)
